<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'model-api-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'model_name'); ?>
		<?php echo $form->textField($model,'model_name',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'model_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'model_api_name'); ?>
		<?php echo $form->textField($model,'model_api_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'model_api_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'api_method'); ?>
		<?php echo $form->textField($model,'api_method',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'api_method'); ?>
	</div>

	<div class="row">
		<?php /*echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textField($model,'description',array('size'=>60,'maxlength'=>500)); ?>
		<?php echo $form->error($model,'description'); */?>
	    <?php $this->widget('ext.keditor.KEditor',array(  
                'model'=>$model,  //传入form model  
                'name'=>'description', //设置name  
                'properties'=>array(  
                    //设置接收文件上传的action  
                    'uploadJson'=>'/admin/default/upload',  
                    //设置浏览服务器文件的action，这两个就是上面配置在/admin/default的  
                    'fileManagerJson'=>'/admin/default/manageJson',  
                    'newlineTag'=>'br',  
                    'allowFileManager'=>true,  
                    //传值前加js:来标记这些是js代码  
                    'afterCreate'=>"js:function() {  
                            K('#ChapterForm_all_len').val(this.count());  
                            K('#ChapterForm_word_len').val(this.count('text'));  
                        }",  
                    'afterChange'=>"js:function() {  
                            K('#ChapterForm_all_len').val(this.count());  
                            K('#ChapterForm_word_len').val(this.count('text'));  
                        }",  
                ),   
                'textareaOptions'=>array(  
                    'style'=>'width:98%;height:300px;',  
                )  
            )); ?>  
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->